<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>表格的增删查改</title>
    <style>
        table {width: 100%;border-collapse: collapse;}
        table, th, td {border: 1px solid black;text-align: center;padding: 8px;}
        button {margin: 10px;}
    </style>
</head>
<body>
    <h2 style="text-align: center;">表格的增删改查</h2>
    <button onclick="addRow()">新增数据</button>
    <table id="dataTable">
        <thead>
            <tr>
                <th>姓名</th>
                <th>联系方式</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>张三</td>
                <td>123456789</td>
                <td>
                    <button onclick="editRow(this)">编辑</button>
                    <button onclick="deleteRow(this)">删除</button>
                </td>
            </tr>
        </tbody>
    </table>
    <script src="table.js"></script>
</body>
</html>